<template>
    <el-row>
        <el-col :xs="{ span: 24 }" :sm="{ span: 24 }">
            <el-form-item :label="label" prop="pay_way">
                <el-radio-group v-model="modelValue" size="small" @change="handleChange">
                    <el-radio-button v-for="(item, _index) in list" :key="_index" :label="item.value">
                        {{ item.label }}
                    </el-radio-button>
                </el-radio-group>
            </el-form-item>
        </el-col>
    </el-row>
</template>

<script setup lang="ts" name="ColeSearchRadioGroup">
import { ref } from 'vue';


const emits = defineEmits(["update:value", "handleChange"]);

const handleChange = (e: any) => {
    emits('update:value', e)
    emits('handleChange')
}

interface ISearchProps {
    label?: any;
    list?: any;
    value?: any;
}
const props = withDefaults(defineProps<ISearchProps>(), {
    label: "ColeSearchRadioGroup",
    list: [],
    value: "",
});
const modelValue = ref(props.value)

</script>

<style scoped></style>